import request from '@/utils/request'

export function getCostOrgRelation(params) {
  return request({
    url: '/api/app/a-pICost-org-relation/a-pICost-org-relation-list',
    method: 'get',
    baseURL: public_config.labor_api,
    params
  })
}

export function getByIdCostOrgRelation(id) {
  return request({
    url: `/api/app/a-pICost-org-relation/${id}/a-pICost-org-relation`,
    method: 'get',
    baseURL: public_config.labor_api
  })
}

export function getERPCostCenter(data) {
  return request({
    url: '/api/app/a-pIERPCost-center/find-list',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}

export function getOAOrg(data) {
  return request({
    url: '/api/app/a-pIOAOrg/find-list',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}

export function insertOrupdateCostOrgRelation(data) {
  return request({
    url: '/api/app/a-pICost-org-relation/update-aPICost-org-relation',
    method: 'post',
    baseURL: public_config.labor_api,
    data
  })
}

export function deleteCostOrgRelation(id) {
  return request({
    url: `/api/app/a-pICost-org-relation/a-pICost-org-relation/${id}`,
    method: 'delete',
    baseURL: public_config.labor_api
  })
}
